

#include <boost/functional/value_factory.hpp>
#include <boost/functional/factory.hpp>

#include <iostream>

class test{


	int m_x;
	int m_y;
public:
	test(int x,int y)
		: m_x(x)
		, m_y(y)
	{}

	int get_res() const{
		return m_x + m_y;
	}
};

int main(int argc, char** argv){

	int x=5;
	int z=6;
	test t1 = boost::value_factory<test>()(x,z);
	test* t2 = boost::factory<test*>()(x,z);	

	std::cout << t1.get_res() << std::endl;
	std::cout << t2->get_res() << std::endl;
	return 0;
}
